#include<iostream>
#include<iomanip>
using namespace std;
class Shape
{
public:
    virtual void GetArea()
    {
        cout<<"0000"<<endl;
    }
};
class Rectangle: public Shape
{
private:
    int x;
    int y;
public:
    void setRectangle(int m,int n)
    {
        x=m;
        y=n;
    }
    virtual void GetArea()
    {
        cout<<x*y<<endl;
    }
};
class Circle:public Shape
{
private:
    int r;
public:
    void setCircle(int x)
    {
        r=x;
    }
    virtual void GetArea()
    {
        cout<<r*r*3.14<<endl;
    }
};
class Square:public Rectangle
{
private:
    int m;
public:
    void setSquare(int x)
    {
        m=x;
    }
    virtual void GetArea()
    {
        cout<<m*m<<endl;
    }
};
int main()
{
    Rectangle r;
    Circle c;
    Square s;
    int a,b,d,e;
    cin>>a>>b>>d>>e;
    r.setRectangle(a,b);
    c.setCircle(d);
    s.setSquare(e);
    r.GetArea();
    c.GetArea();
    s.GetArea();
}
